table, #msgArea, textarea, #sendImgDiag {
    border: 2px solid grey;
}

/* 用户列表 */

#list {
    width: 200px;
    display: flex;
    flex-direction: column;
}

table {
    flex: auto;
    display: block;
    background-color: Tan;
}

th {
    height: 30px;
    width: 200px;
    background-color: LightPink;
    font-size: 1.5em;
}

td>div {
    display: flex;
    align-items: center;
}

td img, .icon {
    width: 32px;
    height: 32px;
}

div.selfUser {
    background-color: PaleGreen;
    font-weight: bold;
}

/* 消息区 */

#main {
    flex: 1;
}

#main, #msgArea>div, #msgArea+div {
    display: flex;
    flex-flow: column nowrap;
}

#msgArea>div {
    flex: none;
}

#msgArea {
    flex: auto;
    background-color: Lavender;
    overflow-y: auto;
}

#msgArea>div>div {
    width: 60%;
    display: flex;
    flex-flow: column nowrap;
}

#msgArea>div>div, pre>span {
    color: blue;
}

div.selfMsg {
    align-self: flex-end;
    text-align: right;
}

div.selfMsg, pre>span.selfMsg {
    color: green!important;
}

#msgArea>div>div>div {
    display: flex;
    padding: 5px;
}

.selfMsg>div {
    justify-content: flex-end;
}

.selfMsg>div>img {
    order: 2;
}

label, .msgImgDiv {
    padding: 10px;
    background-color: white;
    white-space: pre-wrap;
    word-break: break-word;
}

.msgImgDiv {
    flex: auto;
}

.msgImgDiv, .msgImgDiv>img, .opBar, #uploadImgDiv>div, button>span, #preview, #preview>span, #preview>*, pre>span, pre>img, mark {
    margin: 0px;
}

.msgImgDiv>img, #previewImg {
    max-width: 100%;
    max-height: 100%;
}

.selfMsg label, .selfMsg .msgImgDiv {
    background-color: PaleGreen;
}

/* 操作栏及输入栏等下方区域 */

#msgArea+div {
    flex: none;
    height: 220px;
}

.opBar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.opBar>div {
    flex: auto;
    display: flex;
    align-items: center;
}

#color, #fontSize, input[type=radio], #historyUser, #keyword {
    margin-right: 25px;
}

#fontSize {
    width: 100px;
}

#uploadImgDiv>div, .msgImgDiv>img, #previewImg, pre>img {
    border-radius: 0px;
}

#uploadImgDiv {
    width: 40px;
    height: 40px;
    align-items: center;
}

#uploadImgDiv {
    border: 1px solid grey;
}

input[type=file] {
    width: 38px;
    height: 38px;
}

#uploadImgDiv>div {
    width: 19px;
    height: 19px;
    float: left;
}

#uploadImgDiv>div:nth-of-type(1) {
    border-top-left-radius: 10px;
    background: linear-gradient(to top right, #00F, #F00);
}

#uploadImgDiv>div:nth-of-type(2) {
    border-top-right-radius: 10px;
    background: linear-gradient(to bottom right, #F00, #FF0);
}

#uploadImgDiv>div:nth-of-type(4) {
    border-bottom-right-radius: 10px;
    background: linear-gradient(to bottom left, #FF0, #0F0);
}

#uploadImgDiv>div:nth-of-type(3) {
    border-bottom-left-radius: 10px;
    background: linear-gradient(to top left, #0F0, #00F);
}

button:not(#sendImg) {
    width: 80px;
    height: 40px;
    align-self: flex-end;
}

textarea {
    flex: auto;
    background-color: LightCyan;
    padding: 5px;
    resize: none;
}

textarea+div {
    display: flex;
    justify-content: flex-end;
}

button>span {
    text-decoration: underline;
}

/* 图片预览及聊天记录dialog相关 */

dialog {
    padding: 0px;
    background-color: LightYellow;
    box-shadow: 10px 10px 5px dimgray;
    transform: rotate3D(0.5, 0.5, 0.5, 0deg) scale(0.5, 0.5);
}

dialog * {
    backface-visibility: hidden;
}

dialog[transform] {
    transform: rotate3D(1, 1, 1, 360deg) scale(1, 1);
    transition: transform 1s;
    transform-style: preserve-3d;
}

dialog>div {
    display: flex;
    flex-flow: column nowrap;
    align-self: center;
}

dialog>div>span {
    background-color: LightSalmon;
    width: auto;
    height: 40px;
    line-height: 40px;
    text-align: center;
}

dialog>div>div {
    display: flex;
    align-items: center;
}

#previewDialog>div>div {
    height: 400px;
    width: 400px;
    justify-content: center;
}

pre {
    height: 500px;
    width: 800px;
    justify-content: flex-start;
    border: ridge;
    background-color: #FAFAFA;
    padding: 5px;
    overflow-y: auto;
    font-size: 14px;
}

mark {
    font-weight: bold;
}

pre>img {
    max-width: 750px;
    max-height: 750px;
}

svg {
    width: 330px;
    height: 50px;
}

line {
    stroke: grey;
    stroke-width: 3px;
}

span.dateLine {
    line-height: 60px;
    vertical-align: top;
    color: gray;
    font-weight: bold;
}

progress {
    height: 20px;
    width: auto;
    border: solid 1px teal;
    visibility: hidden;
}

progress, progress::-webkit-progress-bar, progress::-webkit-progress-value {
    border-radius: 10px;
}

progress::-webkit-progress-bar {
    background-color: LightCyan;
}

progress::-webkit-progress-value {
    background-color: LimeGreen;
}

#historyUser, #keyword {
    width: 100px;
    padding: 5px;
}

#historyUser:read-only, #keyword:read-only {
    background-color: whitesmoke;
}

#historyUser::-webkit-calendar-picker-indicator {
    display: none;
}

#btnSearch:not([disabled]):hover {
    border: outset 1px;
}

#btnSearch:not([disabled]):active {
    border: inset 1px;
}

dialog>div>div>div {
    flex: 0 1 auto;
}

dialog>div>button {
    width: 100px;
    height: 40px;
    align-self: center;
}